authApp.value('page','datafill'); 


authApp.controller("bsDataController",function($scope,$http,$cookies,$getQueryString){
	
	$scope.isAddZYC=true;
	$scope.isAddZYP=true;
	if($getQueryString("isfill")=="2"){
		$scope.isHideAction=true;
	}
	$scope.savaInfo=function(type){
		var confirmHtml="是否保存";
		if(type=="sub"){
			confirmHtml="是否提交";
		}
		if(window.confirm(confirmHtml)){
			var methodUrl=apis.insertschoolRunning;
			var methodStatus="0";
			var alertMsg="保存成功";
			if($getQueryString("isfill")=="1"){
				methodUrl=apis.updateSchoolRunning;
			}else if($getQueryString("isfill")=="0"){
				methodUrl=apis.insertschoolRunning;
			}else{
				$scope.isHideAction=true;
			}
			if(type=="su"){
				methodStatus="0";
				alertMsg="保存成功";
			}else if(type=="sub"){
				methodStatus="1";
				alertMsg="提交成功";
			}
			/*if(!$scope.schoolStartTime||$scope.schoolStartTime.length<6){
				alert("请输入正确的时间");
				return
			}
			if(!$scope.reorganizationTime||$scope.reorganizationTime.length<6){
				alert("请输入正确的时间");
				return
			}
			if(!$scope.schoolUpgradedCollegeTime||$scope.schoolUpgradedCollegeTime.length<6){
				alert("请输入正确的时间");
				return
			}
			if(!$scope.undergraduateSchoolTime||$scope.undergraduateSchoolTime.length<6){
				alert("请输入正确的时间");
				return
			}
			if(!$scope.undergraduateProfessionalStartTime||$scope.undergraduateProfessionalStartTime.length<6){
				alert("请输入正确的时间");
				return
			}
			if(!$scope.specialtyStartupTime||$scope.specialtyStartupTime.length<6){
				alert("请输入正确的时间");
				return
			}*/
			var GZTArray=$scope.GZT.split(",");
			var SZTArray=$scope.SZT.split(",");
			var planType="";
			angular.forEach(GZTArray,function(i,index){
				if(index==(GZTArray.length-1)){
					planType+="0";
				}else{
					planType+="0,";
				}
			})
			planType+=",";
			angular.forEach(SZTArray,function(i,index){
				if(index==(SZTArray.length-1)){
					planType+="1";
				}else{
					planType+="1,";
				}
			})
			$http({
				method:'post',
				url:methodUrl,
				data:{
					'status':methodStatus,
					'schoolStartTime':$scope.schoolStartTime,
					'reorganizationTime':$scope.reorganizationTime,
					'schoolUpgradedCollegeTime':$scope.schoolUpgradedCollegeTime,
					'undergraduateSchoolTime':$scope.undergraduateSchoolTime,
					'undergraduateProfessionalStartTime':$scope.undergraduateProfessionalStartTime,
					'specialtyStartupTime':$scope.specialtyStartupTime,
					'planType':planType,
					'planTime':$scope.GZT+","+$scope.SZT,
				},
			}).success(function(response){
				if(response.code=="000000"){
					alert(alertMsg);
					location.href="../datafill.html";
				}
				$scope.judeAllList=response.data;
			})
		}
	}
	$scope.showAddC=function(){
		$scope.isAddZYC=false;
		$scope.isAddZYP=true;
	}
	$scope.showAddP=function(){
		$scope.isAddZYC=true;
		$scope.isAddZYP=false;
	}
	$scope.hideAddC=function(){
		$scope.isAddZYC=true;
		$scope.addZYCValue="";
	}
	$scope.hideAddP=function(){
		$scope.isAddZYP=true;
		$scope.addZYPValue="";
	}
	$scope.addCZYValue=function(){
		if(!$scope.addZYCValue){
			alert("请输入正确的时间");
		}else{
			if(!$scope.GZT){
				$scope.GZT=$scope.addZYCValue;
			}else{
				$scope.GZT+=","+$scope.addZYCValue;
			}
			$scope.isAddZYC=true;
			$scope.addZYCValue="";
		}
	}
	$scope.addSZYValue=function(){
		if(!$scope.SZT){
			$scope.SZT=$scope.addZYPValue;
		}else{
			$scope.SZT+=","+$scope.addZYPValue;
		}
		$scope.isAddZYP=true;
		$scope.addZYPValue="";
	}
	$scope.getInfo=function(){
		$http({
			method:'post',
			url:apis.querySchoolRunningBySchoolId,
			data:{
				
			},
		}).success(function(response){
			if(response.code=="000000"){
				$scope.schoolStartTime=response.data.authSchoolRunningData.schoolStartTime;
				$scope.reorganizationTime=response.data.authSchoolRunningData.reorganizationTime;
				$scope.schoolUpgradedCollegeTime=response.data.authSchoolRunningData.schoolUpgradedCollegeTime;
				$scope.undergraduateSchoolTime=response.data.authSchoolRunningData.undergraduateSchoolTime;
				$scope.undergraduateProfessionalStartTime=response.data.authSchoolRunningData.undergraduateProfessionalStartTime;
				$scope.specialtyStartupTime=response.data.authSchoolRunningData.specialtyStartupTime;
				$scope.GZT=response.data.countryPlanTime;
				$scope.SZT=response.data.provincePlanTime;
			}
			$scope.judeAllList=response.data;
		})
	}
	if($getQueryString("isfill")=="1"||$getQueryString("isfill")=="2"){
		$scope.getInfo();
	}
})



authApp.controller("studentDataController",function($scope,$http,$cookies,$getQueryString){
	if($getQueryString("isfill")=="2"){
		$scope.isHideAction=true;
		$scope.isDisabled=true;
	}
	if($getQueryString("isfill")=="1"){
		$scope.isShowAction=true;
		$scope.isHideAction=true;
	}
	$scope.sunjectList=[{'subjectname':"",'gradeNumOne':"",'gradeNumTwo':"",'gradeNumThree':"",'gradeNumFour':"",}]
	$scope.savaInfo=function(type){
		var confirmHtml="是否保存";
		if(type=="sub"){
			confirmHtml="是否提交";
		}
		if(window.confirm(confirmHtml)){
			var methodUrl=apis.insertStudentData;
			var methodStatus="0";
			var alertMsg="保存成功";
			if($getQueryString("isfill")=="1"){
				methodUrl=apis.updateStudentData;
			}else if($getQueryString("isfill")=="0"){
				methodUrl=apis.insertStudentData;
			}else{
				$scope.isHideAction=true;
			}
			if(type=="su"){
				methodStatus="0";
				alertMsg="保存成功";
			}else if(type=="sub"){
				methodStatus="1";
				alertMsg="提交成功";
			}
			var subjectname="";
			var grade="";
			var gradeNumOne="";
			var gradeNumTwo="";
			var gradeNumThree="";
			var gradeNumFour="";
			var wholeNum ="";
			gradeNumOneName=$scope.gradeNumOneName+","+$scope.gradeNumTwoName+","+$scope.gradeNumThreeName+","+$scope.gradeNumFourName;
			angular.forEach($scope.sunjectList,function(list,index,array){
				if(index==array.length-1){
					subjectname+=list.subjectname;
					gradeNumOne+=list.gradeNumOne;
					gradeNumTwo+=list.gradeNumTwo;
					gradeNumThree+=list.gradeNumThree;
					gradeNumFour+=list.gradeNumFour;
					wholeNum+=(parseInt(list.gradeNumOne)+parseInt(list.gradeNumTwo)+parseInt(list.gradeNumThree)+parseInt(list.gradeNumFour));
				}else{
					subjectname+=list.subjectname+",";
					gradeNumOne+=list.gradeNumOne+",";
					gradeNumTwo+=list.gradeNumTwo+",";
					gradeNumThree+=list.gradeNumThree+",";
					gradeNumFour+=list.gradeNumFour+",";
					wholeNum+=(parseInt(list.gradeNumOne)+parseInt(list.gradeNumTwo)+parseInt(list.gradeNumThree)+parseInt(list.gradeNumFour))+",";
				}
			})
			$http({
				method:'post',
				url:methodUrl,
				data:{
					'graduatedStudents':$scope.graduatedStudents,
					'graduatedUndergraduateMajor':$scope.graduatedUndergraduateMajor,
					'graduatedSpecializedSubject':$scope.graduatedSpecializedSubject,
					'schoolAllStudents':$scope.schoolAllStudents,
					'allUndergraduateMajor':$scope.allUndergraduateMajor,
					'allSpecializedSubject':$scope.allSpecializedSubject,
					'inschoolStudents':$scope.inschoolStudents,
					'inschoolUndergraduateMajor':$scope.inschoolUndergraduateMajor,
					'inschoolSpecializedSubject':$scope.inschoolSpecializedSubject,
					'inschoolboy':$scope.inschoolboy,
					'inschoolgirl':$scope.inschoolgirl,
					'teacherQualificationCertificate':$scope.teacherQualificationCertificate,
					'relevantEducationalInstitutions':$scope.relevantEducationalInstitutions,
					'employingUnits':$scope.employingUnits,
					'subjectname':subjectname,
					'grade':gradeNumOneName,
					'gradeNumOne':gradeNumOne,
					'gradeNumTwo':gradeNumTwo,
					'gradeNumThree':gradeNumThree,
					'gradeNumFour':gradeNumFour,
					'wholeNum':wholeNum,
					'status':methodStatus,
					'remark1':$scope.remark1,
					'remark2':$scope.remark2,
					'remark3':$scope.remark3,
					'remark4':$scope.remark4,
					'remark5':$scope.remark5,
					'remark6':$scope.remark6,
					'remark7':$scope.remark7,
					'remark8':$scope.remark8,
					'remark9':$scope.remark9,
					'remark10':$scope.remark10,
					'remark11':$scope.remark11,
					'remark12':$scope.remark12,
					'remark13':$scope.remark13,
					'remark14':$scope.remark14,
				},
			}).success(function(response){
				if(response.code=="000000"){
					alert(alertMsg);
					location.href="../datafill.html";
				}
				$scope.judeAllList=response.data;
			})
		}
	}
	$scope.addSubCollun=function(){
		var addCObj={'subjectname':"",'gradeNumOne':"",'gradeNumTwo':"",'gradeNumThree':"",'gradeNumFour':"",};
		$scope.sunjectList.push(addCObj);
	}
	$scope.deleCollen=function($index){
		$scope.sunjectList.splice($index,1);
	}
	$scope.getInfo=function(){
		$http({
			method:'post',
			url:apis.queryStudentDataBySchoolId,
			data:{
			},
		}).success(function(response){
			if(response.code=="000000"){
				$scope.graduatedStudents=response.data.authStudentData.graduatedStudents;
				$scope.graduatedUndergraduateMajor=response.data.authStudentData.graduatedUndergraduateMajor;
				$scope.graduatedSpecializedSubject=response.data.authStudentData.graduatedSpecializedSubject;
				$scope.schoolAllStudents=response.data.authStudentData.schoolAllStudents;
				$scope.allUndergraduateMajor=response.data.authStudentData.allUndergraduateMajor;
				$scope.allSpecializedSubject=response.data.authStudentData.allSpecializedSubject;
				$scope.inschoolStudents=response.data.authStudentData.inschoolStudents;
				$scope.inschoolUndergraduateMajor=response.data.authStudentData.inschoolUndergraduateMajor;
				$scope.inschoolSpecializedSubject=response.data.authStudentData.inschoolSpecializedSubject;
				$scope.inschoolboy=response.data.authStudentData.inschoolboy;
				$scope.inschoolgirl=response.data.authStudentData.inschoolgirl;
				$scope.teacherQualificationCertificate=response.data.authStudentData.teacherQualificationCertificate;
				$scope.relevantEducationalInstitutions=response.data.authStudentData.relevantEducationalInstitutions;
				$scope.employingUnits=response.data.authStudentData.employingUnits;
				$scope.gradeNumOneName=response.data.authStudentSubjectMap[0].gradeOne;
				$scope.gradeNumTwoName=response.data.authStudentSubjectMap[0].gradeTwo;
				$scope.gradeNumThreeName=response.data.authStudentSubjectMap[0].gradeThree;
				$scope.gradeNumFourName=response.data.authStudentSubjectMap[0].gradeFour;
				$scope.remark1=response.data.authStudentData.remark.split("#")[0];
				if($scope.remark1=="null"){
					$scope.remark1=="无";
				}
				$scope.remark2=response.data.authStudentData.remark.split("#")[1];
				$scope.remark3=response.data.authStudentData.remark.split("#")[2];
				$scope.remark4=response.data.authStudentData.remark.split("#")[3];
				$scope.remark5=response.data.authStudentData.remark.split("#")[4];
				$scope.remark6=response.data.authStudentData.remark.split("#")[5];
				$scope.remark7=response.data.authStudentData.remark.split("#")[6];
				$scope.remark8=response.data.authStudentData.remark.split("#")[7];
				$scope.remark9=response.data.authStudentData.remark.split("#")[8];
				$scope.remark10=response.data.authStudentData.remark.split("#")[9];
				$scope.remark11=response.data.authStudentData.remark.split("#")[10];
				$scope.remark12=response.data.authStudentData.remark.split("#")[11];
				$scope.remark13=response.data.authStudentData.remark.split("#")[12];
				$scope.remark14=response.data.authStudentData.remark.split("#")[13];
								
				
				angular.forEach(response.data.authStudentSubjectMap,function(list,index,array){
					if(index>0){
						var addCObj={'subjectname':"",'gradeNumOne':"",'gradeNumTwo':"",'gradeNumThree':"",'gradeNumFour':"",};
						$scope.sunjectList.push(addCObj);
						$scope.sunjectList[index].subjectname=list.subjectname;
						$scope.sunjectList[index].gradeNumOne=list.gradeNumOne;
						$scope.sunjectList[index].gradeNumTwo=list.gradeNumTwo;	
						$scope.sunjectList[index].gradeNumThree=list.gradeNumThree;
						$scope.sunjectList[index].gradeNumFour=list.gradeNumFour;
					}else{
						$scope.sunjectList[index].subjectname=list.subjectname;
						$scope.sunjectList[index].gradeNumOne=list.gradeNumOne;
						$scope.sunjectList[index].gradeNumTwo=list.gradeNumTwo;	
						$scope.sunjectList[index].gradeNumThree=list.gradeNumThree;
						$scope.sunjectList[index].gradeNumFour=list.gradeNumFour;
					}
					console.log($scope.sunjectList);
				})
				/*subjectname=response.data.authStudentData.
				gradeNumOneName=response.data.authStudentData.
				gradeNumOne=response.data.authStudentData.
				gradeNumTwo=response.data.authStudentData.
				gradeNumThree=response.data.authStudentData.
				gradeNumFour=response.data.authStudentData.
				wholeNum=response.data.authStudentData.*/
			}
			$scope.judeAllList=response.data;
		})
	}
	if($getQueryString("isfill")=="1"||$getQueryString("isfill")=="2"){
		$scope.getInfo();
	}
})

authApp.controller("teacherDataController",function($scope,$http,$cookies,$getQueryString){
	if($getQueryString("isfill")=="2"){
		$scope.isHideAction=true;
	}
	$scope.savaInfo=function(type){
		var confirmHtml="是否保存";
		if(type=="sub"){
			confirmHtml="是否提交";
		}
		if(window.confirm(confirmHtml)){
			var methodUrl=apis.insertTeacherData;
			var methodStatus="0";
			var alertMsg="保存成功";
			if($getQueryString("isfill")=="1"){
				methodUrl=apis.updateTeacherData;
			}else if($getQueryString("isfill")=="0"){
				methodUrl=apis.insertTeacherData;
			}else{
				$scope.isHideAction=true;
			}
			if(type=="su"){
				methodStatus="0";
				alertMsg="保存成功";
			}else if(type=="sub"){
				methodStatus="1";
				alertMsg="提交成功";
			}
			$http({
				method:'post',
				url:methodUrl,
				data:{
					'fulltimeTeacherNum':$scope.fulltimeTeacherNum,
					'schoolSeriesNum':$scope.schoolSeriesNum,
					'schoolPrivatdozentNum':$scope.schoolPrivatdozentNum,
					'professionalFulltimeTeacherNum':$scope.professionalFulltimeTeacherNum,
					'professionalSeriesNum':$scope.professionalSeriesNum,
					'professionalPrivatdozentNum':$scope.professionalPrivatdozentNum,
					'higherEducationFulltimeTeacherNum':$scope.higherEducationFulltimeTeacherNum,
					'doctoralTeachersNum':$scope.doctoralTeachersNum,
					'masterTeachersNum':$scope.masterTeachersNum,
					'readingDoctoralTeachersNum':$scope.readingDoctoralTeachersNum,
					'readingMasterTeachersNum':$scope.readingMasterTeachersNum,
					'masterRatio':$scope.masterRatio,
					'highProfessionalEducationFulltimeTeacherNum':$scope.highProfessionalEducationFulltimeTeacherNum,
					'doctoralDegreeNum':$scope.doctoralDegreeNum,
					'readingMasterNum':$scope.readingMasterNum,
					'seniorFulltimeTeacherNum':$scope.seniorFulltimeTeacherNum,
					'schoolProfessorNum':$scope.schoolProfessorNum,
					'schoolAssociateProfessorNum':$scope.schoolAssociateProfessorNum,
					'professionalHigherFulltimeTeacherNum':$scope.professionalHigherFulltimeTeacherNum,
					'professionalAssociateProfessorNum':$scope.professionalAssociateProfessorNum,
					'professionalProfessorNum':$scope.professionalProfessorNum,
					'professionalLecturerNum':$scope.professionalLecturerNum,
					'oneyearKindergartenTeachersNum':$scope.oneyearKindergartenTeachersNum,
					'noyearKindergartenTeachersNum':$scope.noyearKindergartenTeachersNum,
					'excellentTeachersNum':$scope.excellentTeachersNum,
					'status':methodStatus,
				},
			}).success(function(response){
				if(response.code=="000000"){
					alert(alertMsg);
					location.href="../datafill.html";
				}else{
					alert(response.errorMsg);
				}
			})
		}
	}
	
	$scope.getInfo=function(){
		$http({
			method:'get',
			url:apis.queryTeacherDataBySchoolId,
		}).success(function(response){
			if(response.code=="000000"){
				$scope.fulltimeTeacherNum=response.data.fulltimeTeacherNum;
				$scope.schoolSeriesNum=response.data.schoolSeriesNum;
				$scope.schoolPrivatdozentNum=response.data.schoolPrivatdozentNum;
				$scope.professionalFulltimeTeacherNum=response.data.professionalFulltimeTeacherNum;
				$scope.professionalSeriesNum=response.data.professionalSeriesNum;
				$scope.professionalPrivatdozentNum=response.data.professionalPrivatdozentNum;
				$scope.higherEducationFulltimeTeacherNum=response.data.higherEducationFulltimeTeacherNum;
				$scope.doctoralTeachersNum=response.data.doctoralTeachersNum;
				$scope.masterTeachersNum=response.data.masterTeachersNum;
				$scope.readingDoctoralTeachersNum=response.data.readingDoctoralTeachersNum;
				$scope.readingMasterTeachersNum=response.data.readingMasterTeachersNum;
				$scope.masterRatio=response.data.masterRatio;
				$scope.highProfessionalEducationFulltimeTeacherNum=response.data.highProfessionalEducationFulltimeTeacherNum;
				$scope.doctoralDegreeNum=response.data.doctoralDegreeNum;
				$scope.readingDoctoralNum=response.data.readingDoctoralNum;
				$scope.masterDegreeNum=response.data.masterDegreeNum;
				$scope.readingMasterNum=response.data.readingMasterNum;
				$scope.seniorFulltimeTeacherNum=response.data.seniorFulltimeTeacherNum;
				$scope.schoolProfessorNum=response.data.schoolProfessorNum;
				$scope.schoolAssociateProfessorNum=response.data.schoolAssociateProfessorNum;
				$scope.professionalHigherFulltimeTeacherNum=response.data.professionalHigherFulltimeTeacherNum;
				$scope.professionalAssociateProfessorNum=response.data.professionalAssociateProfessorNum;
				$scope.professionalProfessorNum=response.data.professionalProfessorNum;
				$scope.professionalLecturerNum=response.data.professionalLecturerNum;
				$scope.oneyearKindergartenTeachersNum=response.data.oneyearKindergartenTeachersNum;
				$scope.noyearKindergartenTeachersNum=response.data.noyearKindergartenTeachersNum;
				$scope.excellentTeachersNum=response.data.excellentTeachersNum;
			}
		})
	}
	if($getQueryString("isfill")=="1"||$getQueryString("isfill")=="2"){
		$scope.getInfo();
	}
	
})


authApp.controller("resourceDataController",function($scope,$http,$cookies,$getQueryString){
	if($getQueryString("isfill")=="2"){
		$scope.isHideAction=true;
	}
	$scope.savaInfo=function(type){
		var confirmHtml="是否保存";
		if(type=="sub"){
			confirmHtml="是否提交";
		}
		if(window.confirm(confirmHtml)){
			var methodUrl=apis.insertresourceData;
			var methodStatus="0";
			var alertMsg="保存成功";
			if($getQueryString("isfill")=="1"){
				methodUrl=apis.updateResourceData;
			}else if($getQueryString("isfill")=="0"){
				methodUrl=apis.insertresourceData;
			}else{
				$scope.isHideAction=true;
			}
			if(type=="su"){
				methodStatus="0";
				alertMsg="保存成功";
			}else if(type=="sub"){
				methodStatus="1";
				alertMsg="提交成功";
			}
			$http({
				method:'post',
				url:methodUrl,
				data:{
					'totalLibraryCollection':$scope.totalLibraryCollection,
					'electronicBooks':$scope.electronicBooks,
					'relatedProfessionalBooks':$scope.relatedProfessionalBooks,
					'studentRelatedProfessionalBooks':$scope.studentRelatedProfessionalBooks,
					'recommendedBook':$scope.recommendedBook,
					'averageAnnualBook':$scope.averageAnnualBook,
					'readingroomJournals':$scope.readingroomJournals,
					'studentsFreeReading':$scope.studentsFreeReading,
					'studentsDigitalResources':$scope.studentsDigitalResources,
					'professionalJournals':$scope.professionalJournals,
					'skillsTrainingRoomArea':$scope.skillsTrainingRoomArea,
					'sharedArea':$scope.sharedArea,
					'skillsTrainingRoomTypes':$scope.skillsTrainingRoomTypes,
					'sharedRoom':$scope.sharedRoom,
					'equipmentCost':$scope.equipmentCost,
					'sharedDeviceValue':$scope.sharedDeviceValue,
					'status':methodStatus,
				},
			}).success(function(response){
				if(response.code=="000000"){
					alert(alertMsg);
					location.href="../datafill.html";
				}else{
					alert(response.errorMsg);
				}
				$scope.judeAllList=response.data;
			})
		}
	}
	$scope.getInfo=function(){
		$http({
			method:'get',
			url:apis.queryResourceDataBySchoolId,
		}).success(function(response){
			if(response.code=="000000"){
				$scope.totalLibraryCollection=response.data.totalLibraryCollection;
				$scope.electronicBooks=response.data.electronicBooks;
				$scope.relatedProfessionalBooks=response.data.relatedProfessionalBooks;
				$scope.studentRelatedProfessionalBooks=response.data.studentRelatedProfessionalBooks;
				$scope.recommendedBook=response.data.recommendedBook;
				$scope.averageAnnualBook=response.data.averageAnnualBook;
				$scope.readingroomJournals=response.data.readingroomJournals;
				$scope.studentsFreeReading=response.data.studentsFreeReading;
				$scope.studentsDigitalResources=response.data.studentsDigitalResources;
				$scope.professionalJournals=response.data.professionalJournals;
				$scope.skillsTrainingRoomArea=response.data.skillsTrainingRoomArea;
				$scope.sharedArea=response.data.sharedArea;
				$scope.skillsTrainingRoomTypes=response.data.skillsTrainingRoomTypes;
				$scope.sharedRoom=response.data.sharedRoom;
				$scope.equipmentCost=response.data.equipmentCost;
				$scope.sharedDeviceValue=response.data.sharedDeviceValue;
			}
		})
	}
	if($getQueryString("isfill")=="1"||$getQueryString("isfill")=="2"){
		$scope.getInfo();
	}
})


authApp.controller("teachDataController",function($scope,$http,$cookies,$getQueryString){
	if($getQueryString("isfill")=="2"){
		$scope.isHideAction=true;
	}
	$scope.savaInfo=function(type){
		var confirmHtml="是否保存";
		if(type=="sub"){
			confirmHtml="是否提交";
		}
		if(window.confirm(confirmHtml)){
			var methodUrl=apis.insertTeachResource;
			var methodStatus="0";
			var alertMsg="保存成功";
			if($getQueryString("isfill")=="1"){
				methodUrl=apis.updateTeachResourceData;
			}else if($getQueryString("isfill")=="0"){
				methodUrl=apis.insertTeachResource;
			}else{
				$scope.isHideAction=true;
			}
			if(type=="su"){
				methodStatus="0";
				alertMsg="保存成功";
			}else if(type=="sub"){
				methodStatus="1";
				alertMsg="提交成功";
			}
			$http({
				method:'post',
				url:methodUrl,
				data:{
					'latestProfessionalConstructionTime':$scope.latestProfessionalConstructionTime,
					'professionalTrainingProgram':$scope.professionalTrainingProgram,
					'requiredCoursesNum':$scope.requiredCoursesNum,
					'electiveCoursesNum':$scope.electiveCoursesNum,
					'onlineCourseTime':$scope.onlineCourseTime,
					'onlineAssessmentTime':$scope.onlineAssessmentTime,
					'teachingCycle':$scope.teachingCycle,
					'teachingSatisfaction':$scope.teachingSatisfaction,
					'creditSystemTime':$scope.creditSystemTime,
					'basicCourseCredit':$scope.basicCourseCredit,
					'professionalCourseCredits':$scope.professionalCourseCredits,
					'curriculumCredits':$scope.curriculumCredits,
					'countyNum':$scope.countyNum,
					'practiceBase':$scope.practiceBase,
					'educationPracticeBase':$scope.educationPracticeBase,
					'teachingPracticeTime':$scope.teachingPracticeTime,
					'educationalProbation':$scope.educationalProbation,
					'educationalPractice':$scope.educationalPractice,
					'educationalPracticeTime':$scope.educationalPracticeTime,
					'baseInstructor':$scope.baseInstructor,
					'ratioTeacherStudent':$scope.ratioTeacherStudent,
					'fulltimeTeachersLatest':$scope.fulltimeTeachersLatest,
					'parttimeTeachersLatest':$scope.parttimeTeachersLatest,
					'status':methodStatus,
				},
			}).success(function(response){
				if(response.code=="000000"){
					alert(alertMsg);
					location.href="../datafill.html";
				}else{
					alert(response.errorMsg);
				}
				$scope.judeAllList=response.data;
			})
		}
	}
	$scope.getInfo=function(){
		$http({
			method:'post',
			url:apis.queryTeacherResourceDataBySchoolId,
			data:{
			},
		}).success(function(response){
			if(response.code=="000000"){
				$scope.latestProfessionalConstructionTime=response.data.latestProfessionalConstructionTime;
				$scope.professionalTrainingProgram=response.data.professionalTrainingProgram;
				$scope.requiredCoursesNum=response.data.requiredCoursesNum;
				$scope.electiveCoursesNum=response.data.electiveCoursesNum;
				$scope.onlineCourseTime=response.data.onlineCourseTime;
				$scope.onlineAssessmentTime=response.data.onlineAssessmentTime;
				$scope.teachingCycle=response.data.teachingCycle;
				$scope.teachingSatisfaction=response.data.teachingSatisfaction;
				$scope.creditSystemTime=response.data.creditSystemTime;
				$scope.basicCourseCredit=response.data.basicCourseCredit;
				$scope.professionalCourseCredits=response.data.professionalCourseCredits;
				$scope.curriculumCredits=response.data.curriculumCredits;
				$scope.countyNum=response.data.countyNum;
				$scope.practiceBase=response.data.practiceBase;
				$scope.educationPracticeBase=response.data.educationPracticeBase;
				$scope.teachingPracticeTime=response.data.teachingPracticeTime;
				$scope.educationalProbation=response.data.educationalProbation;
				$scope.educationalPractice=response.data.educationalPractice;
				$scope.educationalPracticeTime=response.data.educationalPracticeTime;
				$scope.baseInstructor=response.data.baseInstructor;
				$scope.ratioTeacherStudent=response.data.ratioTeacherStudent;
				$scope.fulltimeTeachersLatest=response.data.fulltimeTeachersLatest;
				$scope.parttimeTeachersLatest=response.data.parttimeTeachersLatest;
				/*$scope.totalLibraryCollection=response.data.totalLibraryCollection;
				$scope.electronicBooks=response.data.electronicBooks;
				$scope.relatedProfessionalBooks=response.data.relatedProfessionalBooks;
				$scope.studentRelatedProfessionalBooks=response.data.studentRelatedProfessionalBooks;
				$scope.recommendedBook=response.data.recommendedBook;
				$scope.averageAnnualBook=response.data.averageAnnualBook;
				$scope.readingroomJournals=response.data.readingroomJournals;
				$scope.studentsFreeReading=response.data.studentsFreeReading;
				$scope.studentsDigitalResources=response.data.studentsDigitalResources;
				$scope.professionalJournals=response.data.professionalJournals;
				$scope.skillsTrainingRoomArea=response.data.skillsTrainingRoomArea;
				$scope.sharedArea=response.data.sharedArea;
				$scope.skillsTrainingRoomTypes=response.data.skillsTrainingRoomTypes;
				$scope.sharedRoom=response.data.sharedRoom;
				$scope.equipmentCost=response.data.equipmentCost;
				$scope.sharedDeviceValue=response.data.sharedDeviceValue;*/
			}
		})
	}
	if($getQueryString("isfill")=="1"||$getQueryString("isfill")=="2"){
		$scope.getInfo();
	}
})

authApp.controller("authMoneyDataController",function($scope,$http,$cookies,$getQueryString){
	if($getQueryString("isfill")=="2"){
		$scope.isHideAction=true;
	}
	$scope.savaInfo=function(type){
		var confirmHtml="是否保存";
		if(type=="sub"){
			confirmHtml="是否提交";
		}
		if(window.confirm(confirmHtml)){
			var methodUrl=apis.insertMoneyResource;
			var methodStatus="0";
			var alertMsg="保存成功";
			if($getQueryString("isfill")=="1"){
				methodUrl=apis.updateMoneyResourceData;
			}else if($getQueryString("isfill")=="0"){
				methodUrl=apis.insertMoneyResource;
			}else{
				$scope.isHideAction=true;
			}
			if(type=="su"){
				methodStatus="0";
				alertMsg="保存成功";
			}else if(type=="sub"){
				methodStatus="1";
				alertMsg="提交成功";
			}
			$http({
				method:'post',
				url:methodUrl,
				data:{
					'trainingFunds':$scope.trainingFunds,
					'professionalTrainingFunds':$scope.professionalTrainingFunds,
					'budgetStandards':$scope.budgetStandards,
					'wereBorn':$scope.wereBorn,
					'averageEducationFundingRatio':$scope.averageEducationFundingRatio,
					'outlayPerStudent':$scope.outlayPerStudent,
					'equipmentInvestment':$scope.equipmentInvestment,
					'professionalLibraryFunding':$scope.professionalLibraryFunding,
					'fundingEducationFundingPer':$scope.fundingEducationFundingPer,
					'status':methodStatus,
				},
			}).success(function(response){
				if(response.code=="000000"){
					alert(alertMsg);
					location.href="../datafill.html";
				}else{
					alert(response.errorMsg);
				}
				$scope.judeAllList=response.data;
			})
		}
	}
	$scope.getInfo=function(){
			$http({
				method:'get',
				url:apis.queryMoneyResourceDataBySchoolId,
			}).success(function(response){
				if(response.code=="000000"){
					$scope.trainingFunds=response.data.trainingFunds;
					$scope.professionalTrainingFunds=response.data.professionalTrainingFunds;
					$scope.budgetStandards=response.data.budgetStandards;
					$scope.wereBorn=response.data.wereBorn;
					$scope.averageEducationFundingRatio=response.data.averageEducationFundingRatio;
					$scope.outlayPerStudent=response.data.outlayPerStudent;
					$scope.equipmentInvestment=response.data.equipmentInvestment;
					$scope.professionalLibraryFunding=response.data.professionalLibraryFunding;
					$scope.fundingEducationFundingPer=response.data.fundingEducationFundingPer;
				}
			})
		
	}
	if($getQueryString("isfill")=="1"||$getQueryString("isfill")=="2"){
		$scope.getInfo();
	}
})